const template = require('art-template');
 template.config('Cache',false);
     template.helper("formatTime",function(val){
         if (! val) {
        // statement
        return val;
    }
    var time = new Date(val)
        // 2016-12-01 10:10
        var year = time.getFullYear();
        var month = time.getMonth()+1;
        var day = time.getDate();
        var hour = time.getHours();
        var minute = time.getMinutes();
        month = month < 10?"0"+month:month;
        day = day < 10?"0"+day:day;
        hour = hour < 10?"0"+hour:hour;
        minute = minute < 10?"0"+minute:minute;
           return (year+"-"+month+"-"+day+" "+hour+":"+minute)
    })

     
// 对外导出
module.exports = template;